<?php

namespace RSP\UserBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Universite
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class Universite
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=255)
     */
    private $nom;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nom
     *
     * @param string $nom
     * @return Universite
     */
    public function setNom($nom)
    {
        $this->nom = $nom;
    
        return $this;
    }

    /**
     * Get nom
     *
     * @return string 
     */
    public function getNom()
    {
        return $this->nom;
    }
    /**
   * @ORM\OneToMany(targetEntity="RSP\UserBundle\Entity\UserUniversite",mappedBy="universite", cascade={"persist"})
   */
  private $usersuniversites;
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->usersuniversites = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add usersuniversites
     *
     * @param \RSP\UserBundle\Entity\UserUniversite $usersuniversites
     * @return Universite
     */
    public function addUsersuniversite(\RSP\UserBundle\Entity\UserUniversite $usersuniversites)
    {
        $this->usersuniversites[] = $usersuniversites;
    
        return $this;
    }

    /**
     * Remove usersuniversites
     *
     * @param \RSP\UserBundle\Entity\UserUniversite $usersuniversites
     */
    public function removeUsersuniversite(\RSP\UserBundle\Entity\UserUniversite $usersuniversites)
    {
        $this->usersuniversites->removeElement($usersuniversites);
    }

    /**
     * Get usersuniversites
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getUsersuniversites()
    {
        return $this->usersuniversites;
    }
     public function __toString() {
        return $this->getNom();
    }
}